<template>
  <div class="administrator">
    <mains :title="'预约详情'"></mains>
    <!-- 内容 -->
    <div class="info">
      <!-- 体检人信息 -->
      <div class="info-container">
        <h3 class="text-center">体检人信息</h3>
        <div class="content">
          <ul class="info-list">
            <li class="info-item">
              <span class="info-label">患者姓名：</span>
              <span class="info-value">{{ list.name }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">就诊卡号：</span>
              <span class="info-value">{{ list.card }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">证件类型：</span>
              <span class="info-value">身份证号</span>
            </li>
            <li class="info-item">
              <span class="info-label">证件号码：</span>
              <span class="info-value">{{ list.self }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">微信昵称：</span>
              <span class="info-value">七尾山姆</span>
            </li>
            <li class="info-item">
              <span class="info-label">手机号码：</span>
              <span class="info-value">{{ list.tel }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">就诊人地址：</span>
              <span class="info-value">{{ list.address }}</span>
            </li>
          </ul>
          <div class="img-box">
            <div class="one">
              <p class="title">患者头像:</p>
              <img :src='list.img' class="img" alt="" />
            </div>
            <div class="one">
              <p class="title">关系:</p>
              <p class="title1">本人</p>
            </div>
          </div>
        </div>
      </div>
      <!-- 预约详情 -->
      <div class="report-detail">
        <h3 class="text-center">预约详情</h3>
        <div class="content">
          <ul class="info-list">
            <li class="info-item">
              <span class="info-label">就诊医院：</span>
              <span class="info-value">北京市第一人民医院/东院</span>
            </li>
            <li class="info-item">
              <span class="info-label">医院地址：</span>
              <span class="info-value">北京市大兴区*路990号</span>
            </li>
            <li class="info-item">
              <span class="info-label">预约体检时间：</span>
              <span class="info-value">{{ list.yvTime }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">候诊时间：</span>
              <span class="info-value">现场排号</span>
            </li>
            <li class="info-item">
              <span class="info-label">体检费：</span>
              <span class="info-value">¥{{ list.money }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">预约时间：</span>
              <span class="info-value">{{ list.yvTime }}</span>
            </li>
            <li class="info-item">
              <span class="info-label">报告时间：</span>
              <div class="info-value">{{ list.yvTime }}{{ list.time }}</div>
              <Button type="primary" @click="toInfo(list.id)">查看报告</Button>
            </li>
            <li class="info-item">
              <span class="info-label">预约备注：</span>
              <input
                type="text"
                placeholder="请输入内容"
                style="
                  width: 500px;
                  border: none;
                  border: 1px solid #ccc;
                  padding: 5px;
                  outline: none;
                "
              />
            </li>
          </ul>
          <div class="img-box">
            <div class="one">
              <p class="title">报道科室:</p>
              <p>门诊三楼分诊台</p>
            </div>
            <div class="one">
              <p class="title">体检套餐:</p>
              <p class="title1">{{ list.clasz }}</p>
            </div>
            <div class="one">
              <p class="title">状态:</p>
              <p class="title1">{{ list.status === 0 ? '已预约' : '等待就诊' }}</p>
            </div>
          </div>
        </div>
        <div class="btn-box">
          <button class="btn1">保存</button>
          <button class="btn2" @click="back">取消</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import mains from '@/components/main.vue'
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { getList } from '@/ncApi/registerApi'
const router = useRouter()
// 获取页面传过来的id
const id = JSON.parse(router.currentRoute.value.query.id)
const currentPage = ref(1)
const pageSize = ref(10)
console.log('ids', id)
const list = ref([])
const getTableList = async () => {
  const res = await getList({ pageNum: currentPage.value, pageSize: pageSize.value })
  console.log('res111', res.data.list)
  let list1 = await res.data.list.find(item => item.id === id)
  console.log("数据",list1)
  list.value = list1
}
onMounted(() => {
  getTableList()
})
const toInfo = (id) => {
  console.log(11)
  router.push({ name: 'ncRegisterGetInfo', query: { id:id } })
}
const back = () => {
  router.push({ name: 'yytj' })
}
</script>
<style scoped>
.btn1,
.btn2 {
  width: 100px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  /* margin-top: 20px; */
  border: none;
  border-radius: 5px;
  background-color: #b5c9ec;
  color: #1d6aee;
  font-weight: bold;
}
.btn1 {
  margin-left: 130px;
  margin-right: 15px;
  background-color: #1d6aee;
  color: #fff;
}
.img-box .one {
  width: 400px;
  display: flex;
  margin-bottom: 25px;
}
.img-box .one .title {
  width: 100px;
}
.img-box .one .img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}
.content {
  width: 95%;
  margin: 25px auto;
  display: flex;
  justify-content: space-between;
}
.report-detail {
  margin-left: 12px;
  width: 98%;
  height: 400px;
  background: #fff;
  border-radius: 10px;
  box-sizing: border-box;
  margin-top: 20px;
}
.info-label {
  width: 100px;
  display: block;
}
.info-value {
  width: 200px;
  display: block;
}
.info-list {
  width: 600px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.info-list .info-item {
  list-style: none;
  width: 200;
  display: flex;
  margin-bottom: 20px;
}
.text-center {
  color: #1d6aee;
  font-weight: 600;
  width: 100%;
  background-color: #efeeee;
  height: 40px;
  padding: 5px 0 5px 20px;
  line-height: 30px;
  border-radius: 10px 10px 0 0;
}
.info-container {
  margin-left: 12px;
  width: 98%;
  height: 230px;
  background: #fff;
  border-radius: 10px;
  box-sizing: border-box;
}
.report-table {
  width: 100%;
  margin-top: 40px;
}

.report-table table {
  width: 100%;
  min-width: 400px; /* 防止表格过窄 */
  border-collapse: collapse;
  margin: 0;
}

.report-table th,
.report-table td {
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.report-table th {
  background: #f5f7fa;
  font-weight: 500;
  color: #333;
}

.report-table td {
  color: #666;
}
</style>
